//创建一个路由器，并暴露出去
//第一步：引入createRouter、组件
import {createRouter, createWebHistory} from "vue-router";
//引入组件
// import Home from "../views/Home.vue";
// import About from "../views/About.vue";
import Home from "@/views/Home.vue";
import About from "@/views/About.vue";

//第二步：创建路由器
const router = createRouter({
    history: createWebHistory(), //路由器工作模式
    routes: [ //一个一个路由规则
        {
            path: '/home',
            component: Home
        },
        {
            path: '/about',
            component: About
        }
    ]
})

//暴露出去router
export default router